# -*- coding:utf-8 -*-

import redis


def fetch_redis():
    r = redis.Redis(host='127.0.0.1', port=6379, db=0,  decode_responses=True)
    # r = redis.Redis(host='127.0.0.1', port=6379, db=0, password=123456,  decode_responses=True)
    return r


if __name__ == '__main__':
    r = fetch_redis()
    # r.get('dd')
    # a = {'uid': '124', 'regression': '70', 'execute_user': 'abc', 'request_id': 'f6e2ccff-8534-42ee-9dd3-64fd2df11c3d',
    #      'case_name': '遍历', 'status': 'schedule', 'create_time': '2022-05-04T10:57:08.755316Z',
    #      'modify_time': '2022-05-04T10:58:56.674523Z', 'case_number_query_key': 'ee9c9ee6-a0a6-45ff-991f-859e19da7a4a',
    #      'police': '837ab995ab1fd40571a35bf71dc4d255a34b8b58d8f164ee31227948a56c4afb'}
    # r.hset('f6e2ccff-8534-42ee-9dd3-64fd2df11c3d', mapping=a)
    r.set('ee9c9ee6-a0a6-45ff-991f-859e19da7a4a', 1)